<!--老师月报评分-->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<!--客服苹果手机出现蓝字的情况-->
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>老师端实习报告批改页</title>
		<script src="../../script/mui.min.js"></script>
		<script src="../../script/jquery.min.js" type="text/javascript"></script>
		<script src="../../script/timecontrol.min.js"></script>
		<script src="../../script/common.js"></script>
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<link rel="stylesheet" href="../../css/timecontrol.min.css" />
		<!--<link rel="stylesheet" href="../../css/CFNetPP_Base.css">-->
		<link rel="stylesheet" href="../../css/base.css"/>
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
	</head>
	<body>
		<div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div>
		<div class="base_navigation_bar base_style_color base_navigation_item_bar">
			<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span>实习评分</span>
			<a class="base_right_item base_hide_item" href="#"> </a>
		</div>
		<div class=" writeReport" style="margin-top: 68px">
			<div class="bgwhite top_10" >
				<p class="title titlepos">
					我的评价
				</p>
				<div class="textare_div">
					<textarea id="wdpj" class="textarea_t bottom_10" placeholder='字数不得少于5个字'></textarea>
				</div>
			</div>
			<div class="myScore top_10" id="lspf">
				<p class="title">
					我的评分
				</p>
				<div class="myScore-starscore clearfix top_15">
					<div class="letter left">
						实习态度：
					</div>
					<div class="star left" id="taiduNum">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
					</div>
				</div>
				<div class="myScore-starscore clearfix top">
					<div class="letter left">
						出勤率：
					</div>
					<div class="star left" id="chuqinNum">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
					</div>
				</div>
				<div class="myScore-starscore clearfix top">
					<div class="letter left">
						工作完成度：
					</div>
					<div class="star left" id="gzwcdNum">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
					</div>
				</div>
				<div class="myScore-starscore clearfix top">
					<div class="letter left">
						技能掌握度：
					</div>
					<div class="star left" id="jnzwdNum">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
						<img src="../../image/icon_xingxing01.png">
					</div>
				</div>
			</div>
			<button id="sumbit_bt" type="button" class=" top_30 bottom_30 mui-btn-warning horcenter btn_submit " onclick="PostTeacherReport()">
				提交
			</button>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script type="text/javascript" src="../../script/base64.min.js"></script>
	<script type="text/javascript">
		var taiduNum = 0;
		var chuqinNum = 0;
		var gzwcdNum = 0;
		var jnzwdNum = 0;
		var poid = ""
		var id = "";
		var stuid = '';
		//		var uid="";
		apiready = function() {
			SendBehaviorTrajectoriesNotifi1('0', '老师端批改实习报告', '112', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
			setupStarClick();
			var page = api.pageParam;
			var reportid = page.id;
			stuid = page.stuid;
			id = reportid;
			//			var sxtypes = pageParam.sxtypes;
			//			//认知实习
			//			if (sxtypes == 1) {
			//				$('#lspf').hide();
			//			}
		};
		function backClick() {
			SendBehaviorTrajectoriesNotifi1('1', '老师端批改实习报告', '112', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
			api.closeWin();
		}

		function PostTeacherReport() {
			var wdpj = $('#wdpj').val();
			if (wdpj == " " || wdpj.length <= 0) {
				api.toast({
					msg : '提交信息不完整,请再次填写',
					duration : 2000,
					location : 'bottom'
				});
			} else if (taiduNum == 0 || chuqinNum == 0 || gzwcdNum == 0 || jnzwdNum == 0) {
				api.toast({
					msg : '未完成学生评分',
					duration : 2000,
					location : 'bottom'
				});
			} else if (wdpj.length < 5) {
				api.toast({
					msg : '评语的长度不能小于5个字符',
					duration : 2000,
					location : 'bottom'
				});
			} else {
				var param = {
					//					uid : $api.getStorage('cfnetppuid'),
					jid : $api.getStorage('cfnetppjid'),
					jyid : id,
					lsid : $api.getStorage('cfnetppuid'),
					uid : $api.getStorage('cfnetppuid'),
					stuid : stuid,
					tcomment : Base64.encode(wdpj), //   评语
//                 tcomment : wdpj,
                     
					tsxtd : taiduNum, //   老师打分-实习态度(返回分值最高10分)
					tcql : chuqinNum, //   老师打分-出勤率
					tgzwcd : gzwcdNum, //   老师打分-工作完成度
					tjnzwd : jnzwdNum, //   老师打分-技能掌握度
					message : api.pageParam.studentname + '的实习报告'
				}
				cfnetppPOST(urlJudge, param, false, function(data, status) {
					hideProgress();
					SendBusinessOperationsLogNotifi('老师端批改实习报告', '112', param, param, '', data, '老师端批改实习报告接口', '112-01')
					if (status == 'success') {
						if (status.data = 1) {
							api.toast({
								msg : '提交成功',
								duration : 2000,
								location : 'bottom'
							});
							sendNotifi();
							setTimeout(function() {
								next();
							}, 1000);
						} else {
							api.toast({
								msg : '填写信息有误',
								duration : 2000,
								location : 'bottom'
							});
						}
					} else {
						api.toast({
							msg : '网络异常,请检查网络',
							duration : 2000,
							location : 'bottom'
						});
					}
				});
			}
		}

		//审核实习报告后，发送通知
		function sendNotifi() {
			api.sendEvent({
				name : 'RefreshReportReviewedNotifi'
			});
		}

		//跳转到实习报告已审核列表
		function next() {
			SendBehaviorTrajectoriesNotifi1('1', '老师端批改实习报告', '112', api.pageParam.sourceurl, api.pageParam.sourcetitle, window.location.pathname, document.title);
			api.closeToWin({
				name : 'Teacher_CompletionReprotWindow',
			});
		}

		function setupStarClick() {
			$('.star img').each(function(i) {
				$(this).click(function() {
					$(this).attr('src', '../../image/icon_xingxing.png');
					$(this).prevAll().attr('src', '../../image/icon_xingxing.png');
					$(this).nextAll().attr('src', '../../image/icon_xingxing01.png');
					var score = ($(this).prevAll().length + 1) * 5;
					if ($(this).parent().attr('id') == 'taiduNum') {//实习态度
						taiduNum = score;
					} else if ($(this).parent().attr('id') == 'chuqinNum') {//出勤率
						chuqinNum = score;
					} else if ($(this).parent().attr('id') == 'gzwcdNum') {//工作完成度
						gzwcdNum = score;
					} else if ($(this).parent().attr('id') == 'jnzwdNum') {//技能掌握度
						jnzwdNum = score;
					}
				})
			});
		}

		$(function() {
			$('.star img').each(function(i) {
				$(this).click(function() {
					$(this).attr('src', '../../image/icon_xingxing.png');
					$(this).prevAll().attr('src', '../../image/icon_xingxing.png');
					$(this).nextAll().attr('src', '../../image/icon_xingxing01.png');
				})
			});
		});
	</script>
</html>